﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MyRoguelike.Game.Objects;

namespace MyRoguelike.Game.Items
{
    class GIBronzeSword : GameItem
    {
        // Stats
        private int _damage = 5;

        public GIBronzeSword()
        {
            IsEquip = true;
            Category = ECategory.Weapon;
            Name = "Bronze Sword";
        }

        public override void On()
        {
            if (!IsOn)
            {
                IsOn = true;

                if (GameObj.IsCreature)
                {
                    GOCreature creature = (GOCreature)GameObj;
                    creature.Damage += _damage;
                }

                if (GameObj.IsPlayer)
                {
                    GOPlayer player = (GOPlayer)GameObj;
                    player.Damage += _damage;
                }
            }
        }

        public override void Off()
        {
            if (IsOn)
            {
                IsOn = false;

                if (GameObj.IsCreature)
                {
                    GOCreature creature = (GOCreature)GameObj;
                    creature.Damage -= _damage;
                }

                if (GameObj.IsPlayer)
                {
                    GOPlayer player = (GOPlayer)GameObj;
                    player.Damage -= _damage;
                }
            }
        }
    }
}
